#ifndef _FactoryMethod_H_
#define _FactoryMethod_H_

#include <iostream>
#include <memory>
using namespace std;

class Button{
public:
    virtual void btn_click()=0;
};

class WindowButton:public Button{
    void btn_click() override;
};
class MacButton:public Button{
    void btn_click() override;
};

//////////////////////////////
//抽象工厂
class ButtonFactory{
public:
    virtual unique_ptr<Button> createButton()=0;
    //不用操作系统下的不同点击效果
};

class WindowsButtonFactory:public ButtonFactory{
    unique_ptr<Button> createButton() override;
};

class MacButtonFactory:public ButtonFactory{
    unique_ptr<Button> createButton() override;
};

#endif